package suites.tween {
	import org.flexunit.asserts.assertEquals;
	import org.splink.library.queue.QEvent;
	import org.splink.library.tween.QTweenConst;

	/**
	 * @author Max Kugland
	 */
	public class TweenResetTest extends AbstractTweenTest {

		[Test (async)]
		public function reset() : void {
			handleAsync(400);
			_tween.add(QTweenConst.ALPHA, 0).duration(100);
			var flag : Boolean = true;
			_tween.register(QEvent.PROGRESS, function(e : QEvent):void {
				if(e.progress.percent > 50 && flag) {
					flag = false;
					_tween.reset();
					assertEquals(1, _target.alpha);
					_tween.start();
				}
			});
			_tween.register(QEvent.COMPLETE, function(e : QEvent):void {
				assertEquals(0, _target.alpha);
			});
			_tween.start();
		}
	}
}
